package co.fitstart.coach.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.demo2do.core.persistence.annotation.Dynamic;

import co.fitstart.coach.dao.CourseDao;
import co.fitstart.coach.dao.ScheduleDaoSupport;
import co.fitstart.coach.service.ScheduleService;
import co.fitstart.entity.course.round.CourseRound;
import co.fitstart.entity.course.schedule.CourseSchedule;
import co.fitstart.entity.course.schedule.ScheduleStatus;

/**
 * 
 * @author wangliwang
 *
 */
@Service("scheduleService")
public class ScheduleServiceImpl implements ScheduleService {
    
    @Autowired
    private ScheduleDaoSupport scheduleDaoSupport;

    @Dynamic
    private CourseDao courseDao;

    /* (non-Javadoc)
     * @see co.fitstart.coach.service.ScheduleService#load(java.lang.Long)
     */
    public CourseSchedule load(Long id) {
        return scheduleDaoSupport.load(id);
    }

    /*
     * (non-Javadoc)
     * @see co.fitstart.coach.service.ScheduleService#list(co.fitstart.entity.course.round.CourseRound, co.fitstart.entity.course.schedule.ScheduleStatus)
     */
    public List<CourseSchedule> list(CourseRound courseRound, ScheduleStatus scheduleStatus) {
        return courseDao.listCourseSchedule(courseRound, ScheduleStatus.FINISH);
    }
}
